<template>
  <div>
    <h2>登录列表</h2>
    <table class="table table-bordered">
      <tr>
        <th>用户名</th>
        <th>密码</th>
        <th>日期</th>
      </tr>
      <tr v-for="item in list">
        <td>{{item.U_Account}}</td>
        <td>{{item.U_Pwd}}</td>
        <td>{{item.U_Date.substr(0,10)}}</td>
      </tr>

    </table>
  </div>
</template>

<script setup lang="ts">
import {ref,onMounted} from 'vue'
import axios from 'axios'

const list=ref([{
  U_Account:'',
  U_Pwd:'',
  U_Date:''
}])
onMounted(()=>{
  Show()
})

const Show=()=>{
  axios({
    url:'http://localhost:59121/api/User/GetLoginList',
    method:'get',
  })
  .then((res)=>{
    console.log(res.data)
    list.value=res.data
  })
  .catch((err)=>{
    console.log(err)
  })
}

</script>